<template>
  <div class="album-container">
    <h2 class="title">公开相册</h2>
    <div class="album-list">
      <figure v-for="item in list" :key="item.name" class="album">
        <div class="cover">
          <img :src="item.src" alt>
        </div>
        <div class="name">{{item.name}}</div>
      </figure>
    </div>
  </div>
</template>

<script>
export default {
  title: '公开相册',
  data() {
    return {
      list: [
        { name: '临时图床', src: 'http://pic.kuan1.top/d955e97b0afaf197203097d17f87799d.jpg', bucket: 'test' },
        { name: '知识图谱', src: 'http://pic.kuan1.top/0f2298aba34faab1929e34977287161a.jpg', bucket: 'test' },
        { name: '个人图床', src: 'http://pic.kuan1.top/37e962471a62679158335fe639c065e7.jpg', bucket: 'test' }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.album-container {
  min-height: 100vh;
  background: #fbfbfb;
  padding-bottom: 50px;
  box-sizing: border-box;
}
.title {
  padding-top: 20px;
  line-height: 4;
  font-weight: normal;
  font-size: 30px;
  text-align: center;
}
.album-list {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.album {
  width: 270px;
  height: 240px;
  background: white;
  margin: 15px;
  border: 1px solid #eee;
  box-sizing: border-box;
  position: relative;
  transition: transform 1s;
  &::before,
  &::after {
    content: " ";
    width: 88%;
    height: 20%;
    box-shadow: 0 12px 12px rgba(0, 0, 0, 0.3);
    position: absolute;
    bottom: 15px;
    transition: box-shadow 1s;
  }
  &::before {
    transform: skew(-15deg) rotate(-5deg);
    left: 15px;
  }
  &::after {
    transform: skew(15deg) rotate(5deg);
    right: 15px;
  }
  &:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 5px #eee;
    &::before,
    &::after {
      box-shadow: 0 15px 12px rgba(0, 0, 0, 0.4);
    }
    img {
      transform: scale(1.2);
    }
    .name {
      color: #333;
    }
  }
  .cover {
    height: 210px;
    position: relative;
    background: #eee;
    z-index: 1;
    overflow: hidden;
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 1s;
  }
  .name {
    background: white;
    height: 30px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    color: #666;
  }
}
</style>
